import * as constants from './constants'
import { fromJS } from 'immutable'

const defaultState=fromJS({
    userInfo:{
        name:'',
        token:'',
        id:''
    }
})



export default (state=defaultState,action)=>{

    switch (action.type) {
        case constants.TOKEN:
            return state.set('userInfo',action.userInfo)
        default:
            return state
    }
}